package member.dao;

import java.util.HashMap;
import java.util.List;

import member.vo.MemberVO;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

public class MemberDAO {
	private SqlMapClientTemplate client;
	
	public void setSqlMapClientTemplate(SqlMapClientTemplate client){
		this.client = client;
	}
	
	public void registMember(HashMap map){
		client.insert("registMember", map);
	}

	public int deleteMember(String id) {
		int cnt = client.delete("deleteMember", id);
		return cnt;
	}

	public HashMap showMember(String id) {
		HashMap mmap = (HashMap) client.queryForObject("selectMemberById", id);
		return mmap;
	}

	public List showAllMember() {
		List mlist = (List)client.queryForList("selectAllMember");
		return mlist;
	}	
	
	public int modifyMember(HashMap map) {
		int cnt = client.update("updateMember", map);
		return cnt;
	}
	
	public int checkMemberByDeptId(String deptid) {
		int cnt = (Integer) client.queryForObject("checkMemberByDeptId", deptid);
		System.out.println("##### cnt :"+cnt+"  deptid : "+deptid);
		return cnt;
	}	
	
}


